package com.example.comiccenter.controller;


import com.example.comiccenter.domain.Score;

import com.example.comiccenter.service.ScoreService;

import com.example.comiccenter.utils.ResultData;
import com.example.comiccenter.utils.SearchBean;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/score/")
public class ScoreController {
    @Resource
    private ScoreService scoreService;


    //分页查询
    @PostMapping("/getAllScore")
    public ResultData selectPage(@RequestBody SearchBean<Score> searchBean){
        System.out.println("查询score");
        return scoreService.getAllScore(searchBean);
    }

    //添加收藏
    @PostMapping("/addScore")
    public ResultData addScore(@RequestBody Score score){
        return scoreService.addScore(score);
    }

    //取消收藏
    @PostMapping("/deleteScore")
    public ResultData deleteScore(@RequestBody Score score){
        System.out.println("删除score："+score);
        return scoreService.deleteScore(score);
    }

}
